import java.awt.Color;
import java.awt.Container;
import java.awt.Dimension;
import java.awt.Font;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;

import javax.swing.JButton;
import javax.swing.JFrame;
import javax.swing.JLabel;

// This Is an educational program for my final.
// Programmers: Jon Stewart (original stuff), Darius Fieschko (sexification)
public class physics_helper extends JFrame implements ActionListener {

	private static final long serialVersionUID = 1L; /*
													 * had to add this to make
													 * Eclipse STFU. It's
													 * probably here for a
													 * reason, but I don't know
													 * what for; it isn't
													 * required. Anyways, don't
													 * delete it.
													 */
	public JButton basic;
	public JButton gravity;
	public JButton planet;
	public JButton laws;
	public JButton ricochet;
	public JLabel physics;

	static physics_helper instance;

	public physics_helper() {
		createGUIInterface();
	}

	private void createGUIInterface() {
		Container contentPane = getContentPane();
		contentPane.setBackground(Color.black);
		contentPane.setLayout(null);
		contentPane.setPreferredSize(new Dimension(450, 300));
		this.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
		this.setLocationRelativeTo(null);

		pack();
		physics = new JLabel("Physics Helper");
		physics.setForeground(Color.MAGENTA);
		physics.setFont(new Font("TimesNewRoman", Font.CENTER_BASELINE, 24));
		physics.setSize(physics.getPreferredSize());
		physics.setLocation(120, 50);// figure out how to center the label
		contentPane.add(physics);

		basic = new JButton("Basic Equations");
		basic.setLocation(50, 100);
		basic.setSize(basic.getPreferredSize());
		contentPane.add(basic);
		basic.addActionListener(this);

		gravity = new JButton("Gravity Equations");
		gravity.setLocation(250, 100);
		gravity.setSize(gravity.getPreferredSize());
		contentPane.add(gravity);
		gravity.addActionListener(this);

		planet = new JButton("Satellite Equations");
		planet.setLocation(50, 150);
		planet.setSize(planet.getPreferredSize());
		contentPane.add(planet);
		planet.addActionListener(this);

		laws = new JButton("Laws");
		laws.setLocation(250, 150);
		laws.setSize(basic.getPreferredSize());
		contentPane.add(laws);
		laws.addActionListener(this);

		ricochet = new JButton("Ricochet Equations");
		ricochet.setLocation(50, 200);
		ricochet.setSize(ricochet.getPreferredSize());
		contentPane.add(ricochet);
		ricochet.addActionListener(this);

		// projectiles = new JButton("Projectile Equations");
		// projectiles.setLocation(350,100);
		// projectiles//finish
		//
		setTitle("Physics Helper");
		setVisible(true);

	}

	public static void main(String[] args) {
		physics_helper application = new physics_helper();
		application.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
	}

	public void actionPerformed(ActionEvent e) {

		if (e.getActionCommand().equals("Basic Equations")) {
			library.basic();
		}
		if (e.getActionCommand().equals("Gravity Equations")) {
			library.gravity();
		}
		if (e.getActionCommand().equals("Satellite Equations")) {
			library.satellite_distance();
		}
		if (e.getActionCommand().equals("Laws")) {
			library.laws();
		}
		if (e.getActionCommand().equals("Ricochet Equations")) {
			library.ricochet();
		}

	}

}